<template>
    <div>
        <el-tabs type="border-card" v-model="item.activeName">
            <el-tab-pane :label="item.label"
                         :name="item.activeName"
                         style="background: white">
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>
    export default {
        name: "detail",
        data(){
            return{
                item:{
                    type:'ADD',
                    label:'新增单元',
                    name:'addDetail'
                },
                activeName: 'addDetail',
            }
        },
        mounted(){
            this.getParams()
        },
        methods:{
            // 判断类型
            getParams(){
                //规则编码
                let type = this.$route.query.type;
                this.detailId = this.$route.query.detailId + '';
                if (type == 'ADD') {
                    this.activeName = 'addDetail'
                }else if (type == 'DETAIL') {
                    this.activeName = 'dDetail';
                    this.item.label = '单元详情'
                }
            },
        },
    }
</script>

<style scoped>

</style>